home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 6 / Amiga Format AFCD06 (Nov 1996, Issue 90).iso / serious / commercial / cloanto / colortype / rexx / help.ctrx < prev    next >
Text File  |  1996-05-05  |  2KB  |  78 lines

  1. /* ColorType Amiga Rexx script - Copyright © 1996 Cloanto Italia srl */
  2.  
  3. /* $VER: Help.ctrx 1.0 */
  4.  
  5. /**
  6.  This script displays a list of all Rexx commands and options for ColorType.
  7.  
  8.  The script can be executed with an argument, which is passed on to the
  9.  "Help" command, and which causes instructions to be displayed either for
  10.  the internal commands and options, or for the I/O modules, or for both.
  11. */
  12.  
  13. IF ARG(1, EXISTS) THEN
  14.     PARSE ARG CTPORT topic output '"' title '"'
  15. ELSE
  16.     CTPORT = 'COLORTYPE'
  17.  
  18. IF ~SHOW('P', CTPORT) THEN DO
  19.     IF EXISTS('ColorType:ColorType') THEN DO
  20.         ADDRESS COMMAND 'Run >NIL: ColorType:ColorType'
  21.         DO 30 WHILE ~SHOW('P',CTPORT)
  22.              ADDRESS COMMAND 'Wait >NIL: 1 SEC'
  23.         END
  24.     END
  25.     ELSE DO
  26.         SAY "ColorType could not be loaded."
  27.         EXIT 10
  28.     END
  29. END
  30.  
  31. IF ~SHOW('P', CTPORT) THEN DO
  32.     SAY 'ColorType Rexx port could not be opened.'
  33.     EXIT 10
  34. END
  35.  
  36. ADDRESS VALUE CTPORT
  37. OPTIONS RESULTS
  38. OPTIONS FAILAT 10000
  39.  
  40. IF output = 'GUI' THEN DO
  41.     Help topic
  42.     helptext = RESULT
  43.     IF topic = 'Command' THEN DO
  44.         Version 'REXX'
  45.         helptext = 'Port Name: 'CTPORT '0a'X || 'Rexx Version: 'RESULT '0a0a'X || helptext
  46.     END
  47.  
  48.     pos = 1
  49.     DO FOREVER
  50.         pos = INDEX(helptext, '"', pos)
  51.         IF pos = 0 THEN
  52.             BREAK
  53.         helptext = INSERT('"', helptext, pos)
  54.         pos = pos + 2
  55.     END
  56.  
  57.     RequestNotify '"'title'" "'helptext'" SCROLL'
  58. END
  59. ELSE DO
  60.     Version 'REXX'
  61.     IF RESULT < 1 THEN DO
  62.         errmess = 'This script requires a newer_version of ColorType.'
  63.         SAY errmess
  64.         RequestNotify 'PROMPT="'errmess'"'
  65.         EXIT 10
  66.     END
  67.  
  68.     SAY '-- ColorType Rexx Version ' RESULT '--' '0a'X
  69.  
  70.     Help
  71.     SAY RESULT
  72.  
  73.     SAY '0a0a'X'-- Available I/O Modules --' '0a'X
  74.  
  75.     Help IOFORMAT
  76.     SAY RESULT
  77. END
  78.